package com.bifrost.cbrepository;

import com.bifrost.cbentity.SapBrand;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author rangf
 * @date 2018/2/26
 */
public interface SapBrandRepository extends JpaRepository<SapBrand, Integer>{
    List<SapBrand> findAllByDstatus(String s);

    @Query(nativeQuery = true , value = "UPDATE BHWSC_PP SET DSTATUS=?2 WHERE NOID=?1 ")
    @Modifying(clearAutomatically = true)
    @Transactional
    int updateDstatus(Long noid, String s);
}
